package ldkxingzhe.ldkxingzhedemo.tab;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;

import com.mikepenz.google_material_typeface_library.GoogleMaterial;
import com.mikepenz.iconics.IconicsDrawable;

import ldkxingzhe.ldkxingzhedemo.R;
import ldkxingzhe.ldkxingzhedemo.utils.LogDemo;


/**
 * Created by liangdengke on 2015/8/25.
 */
public class ToolbarDemoActivity extends AppCompatActivity{

    private final String TAG = ToolbarDemoActivity.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_toolbar);

        Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);

//        toolbar.setTitle(R.id.title);
//        toolbar.setTitle("This is a Toolbar demo");
        toolbar.setNavigationIcon(new IconicsDrawable(this,
                GoogleMaterial.Icon.gmd_chevron_left).color(Color.WHITE).sizeDp(16));
//        setSupportActionBar(toolbar);
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d("TAG", "return was clicked");
                onBackPressed();
            }
        });

        LogDemo.v(TAG,"toobar.getLogoDescription = " + toolbar.getLogoDescription());
    }
/*
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.option_menu_tool_bar,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case R.id.item1:
                Log.d("TAG","you clicked item1");
                break;
            case R.id.item2:
                Log.d("TAG","you clicked item2");
                break;
            default:
                break;
        }
        return super.onOptionsItemSelected(item);
    }*/
}

